import bb.cascades 1.0

Page {
    content: Container {
        // The activity indicator has an object name set so that
        // we can start and stop it from C++
        ActivityIndicator {
            objectName: "indicator"
            verticalAlignment: VerticalAlignment.Fill
            horizontalAlignment: HorizontalAlignment.Fill
        }
        onCreationCompleted: {
            //            _app.loadListMusic("")
        }
        layout: DockLayout {
        }
        onTouch: {
            if (event.touchType == TouchType.Up) {
                tabBackGround.changeBack("");
                _app.loadListMusic("1")
            }
        }
        Label {
            objectName: "titleMusic"
            translationY: 200
            textStyle.fontSizeValue: 30
            text: " Title"
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
        }
        Container {
            animations: [
                SequentialAnimation {
                    id: animationRight
                    animations: [
                        ParallelAnimation {
                            id: animation1
                            animations: [
                                TranslateTransition {
                                    fromX: 0
                                    fromY: 0
                                    toX: 800
                                    toY: -200
                                    duration: 400
                                },
                                FadeTransition {
                                    fromOpacity: 1
                                    toOpacity: 0
                                    duration: 400
                                },
                                RotateTransition {
                                    fromAngleZ: 0
                                    toAngleZ: -90
                                    duration: 400
                                }
                            ]
                        },
                        ParallelAnimation {
                            id: animation2
                            animations: [
                                TranslateTransition {
                                    fromX: -800
                                    fromY: -150
                                    toX: 0
                                    toY: 0
                                    duration: 400
                                },
                                FadeTransition {
                                    fromOpacity: 0
                                    toOpacity: 1
                                    duration: 400
                                },
                                RotateTransition {
                                    fromAngleZ: 90
                                    toAngleZ: 0
                                    duration: 400
                                }
                            ]
                        }
                    ]
                }
            ]
            id: tabBackGround
            objectName: containerImaviewMusicSelected
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
            layout: AbsoluteLayout {
            }
            ImageView {
                id: main
                objectName: imaviewMusicSelected
                imageSource: "asset:///images/loa.png"
                onTouch: {
                    if (event.touchType == TouchType.Up) {
                        navigationPane.push(maingamePage);
                        _app.pushMainGame();
                    }
                }
            }
            function changeBack(url) {
                animationRight.play()
            }
        }
        Container {
            //                    Button {
            //                        text: "goto maingame"
            //                        onClicked: {
            //                            navigationPane.push(secondPage);
            //                            // _app.pushMainGame();
            //                        }
            //                    }
//            Button {
//                text: "goto maingame"
//                onClicked: {
//                    //                    var newPage = maingamePage.createObject();
//                    //                    navigationPane.push(newPage);
//                    navigationPane.push(maingamePage);
//                    _app.pushMainGame();
//                }
//            }
//            Button {
//                text: "goto menu"
//                onClicked: {
//                    navigationPane.pop();
//                }
//            }
        }
    }
}// end of Page
